/**
 * 指令集合对象
 */
const directives = {
  install(app) {
    // prettier-ignore
    const directives = import.meta.glob('./modules/\*.js', { eager: true })
    // 注册全局自定义指令 `v-指令名`
    Object.keys(directives).forEach((key) => {
      const module = directives[key].default
      app.directive(module.name, module)
    })
  }
}

export function setupDirectives(app) {
  app.use(directives)
}
